Skip to content

feat: partial hydration - #951

Open
avivkeller wants to merge 2 commits into
mainfrom
partial-hydration-stacked-2
Open

feat: partial hydration#951
avivkeller wants to merge 2 commits into
mainfrom
partial-hydration-stacked-2

Conversation

@avivkeller

@avivkeller avivkeller commented Jul 27, 2026

Copy link
Copy Markdown
Member

Uses islands from 11ty in order to give us partial hydration

@avivkeller
avivkeller requested a review from a team as a code owner July 27, 2026 23:35
@cursor

cursor Bot commented Jul 27, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes the web generator’s SSR/hydration and bundling model for all pages; regressions could affect interactivity, styling timing, or MDX components like CodeTabs.

Overview
Replaces full-page Preact hydration with partial hydration using @11ty/is-land. Interactive UI is wrapped in islands that hydrate on idle (banner, sidebar, theme) or on pointer/focus/touch (search, code copy, code tabs), while static markup stays in the HTML.

Adds withIsland, a Preact island runtime (registerIslands, dynamic loaders, slot-based child adoption), and wires Banner, ThemeToggle, SearchBox, SideBar, CodeBox, and CodeTabs through it. CodeTabs is vendored locally so it can be island-wrapped (fixes broken tabs when only partial JS loads).

The client bundle is now a single shared entry that registers all island loaders instead of one hydrate program per page; SSR still emits per-page programs but only imports components used on that page. Vite client builds set cssCodeSplit: false so styles are not tied to late-loading island chunks. Layout always renders Banner (no longer gated on client-only server flag).

Bumps @node-core/rehype-shiki and @node-core/ui-components; lockfile reflects transitive Radix/React patch updates.

Reviewed by Cursor Bugbot for commit 7282006. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Jul 30, 2026 11:37pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
nodejs-doc-kit Ignored Ignored Jul 30, 2026 11:37pm

Request Review

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.63%. Comparing base (70b7526) to head (7282006).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #951      +/-   ##
==========================================
+ Coverage   86.50%   86.63%   +0.13%     
==========================================
  Files         195      195              
  Lines       17964    17946      -18     
  Branches     1632     1635       +3     
==========================================
+ Hits        15540    15548       +8     
+ Misses       2418     2392      -26     
  Partials        6        6              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 797e8af. Configure here.

Comment thread packages/core/src/generators/web/ui/index.css
@avivkeller
avivkeller changed the base branch from vite to main July 27, 2026 23:40
@avivkeller
avivkeller marked this pull request as draft July 27, 2026 23:48
Copilot AI review requested due to automatic review settings July 27, 2026 23:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

This comment was marked as off-topic.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread packages/core/src/generators/web/utils/generate.mjs Fixed
Copilot AI review requested due to automatic review settings July 28, 2026 18:23
@avivkeller
avivkeller force-pushed the partial-hydration-stacked-2 branch from 9cefea8 to 8d3b7f5 Compare July 28, 2026 18:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@avivkeller
avivkeller marked this pull request as ready for review July 28, 2026 18:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ovflowd

ovflowd commented Jul 30, 2026

Copy link
Copy Markdown
Member

@avivkeller is this fully working or on a ready state? I see the blocked label?

@ovflowd

ovflowd commented Jul 30, 2026

Copy link
Copy Markdown
Member

Is it only shiki broken?

@avivkeller

Copy link
Copy Markdown
Member Author

@avivkeller is this fully working or on a ready state? I see the blocked label?

It's ready for review, since the implementation on this side is done, but can't land until nodejs/nodejs.org#9028 nodejs/nodejs.org#9047 to

@avivkeller

Copy link
Copy Markdown
Member Author

Unblocked as upstream changes have landed... just dreading the rebase I'm about to make

Copilot AI review requested due to automatic review settings July 30, 2026 23:29
@avivkeller
avivkeller force-pushed the partial-hydration-stacked-2 branch from f8bf410 to 96cebd3 Compare July 30, 2026 23:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

`registerIslands({${componentImports
.map(
({ name, source }) =>
`${JSON.stringify(name)}: () => import(${JSON.stringify(source)})`
Copilot AI review requested due to automatic review settings July 30, 2026 23:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@AugustinMauroy

Copy link
Copy Markdown
Member

idk why but when I take a page an scroll I have some lag spike in safari 26.5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce memory footprint Don't pass pre-rendered components to the client

5 participants